package cn.edu.ncut.cs.springboot.springsecuritydemo.entity;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.Instant;

/**
 * ClassName : Book
 * package : cn.edu.ncut.cs.springboot.springsecuritydemo.entity
 * Description :
 *
 * @ Author Dreama
 * @ Creat 2024/12/24 13:49
 * @ Version 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@Table
public class Book {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id ;
    public long getid(){
        return id;
    }
    @Column(unique = true,nullable = false)
    private String title ;
    public String getTitle(){
        return title;
    }
    @Column(nullable = false)
    private String author ;
    public String getAuthor(){
        return author;
    }
    @Column(nullable = false)
    private String isbn ;
    public String getIsbn(){
        return isbn;
    }


//    public Book(){}
//
//    public Book(String title,String author,String isbn){
//        this.title = title ;
//        this.author = author ;
//        this.isbn = isbn ;
//    }

    /*
    private Long id;
    @Column(unique = true, nullable = false)
    private String username;
    @Column(nullable = false)
    private String password;
    @Column(nullable = false)
    private String salt;
    @Column
    private Instant gmtModified;
    @Column
    private Instant gmtCreate;
     */
}
